#!/bin/bash


#日期
prefix=`date +%Y%m`

mysql -uroot -pkingboyrang@soft8275 -e "use voice_call;CREATE TABLE if not exists  advert_operate_log_$prefix(
   id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
   category varchar(50) DEFAULT NULL COMMENT '类别',
  user_id int(10) NOT NULL COMMENT '用户id(关联user_info.id)',
  integral int(11) unsigned NOT NULL DEFAULT '0' COMMENT '总中奖积分',
  star_integral int(11) unsigned DEFAULT NULL  COMMENT '星级积分',
  ad_time int(11) unsigned DEFAULT NULL  COMMENT '广告时长',
  lucky_integral int(11) unsigned DEFAULT NULL  COMMENT '老虎机积分',
  rand_num int(11) unsigned DEFAULT NULL  COMMENT '随机数',
  status char(1) NOT NULL DEFAULT 'y' COMMENT '状态y:未兑换 ,n已兑换',
  ctime datetime NOT NULL,
  mtime datetime DEFAULT NULL,
  PRIMARY KEY (id),
  KEY index_category (category,user_id,status,ctime,ad_time)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='广告点击送积分记录';"